<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<html lang="en">
<head>
  <title>Haru Free PDF Library</title>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <link href="api.css" type="text/css" rel="stylesheet">
</head>
<body>
<div id="headcontainer">
<div class="head"><img alt="Haru Free PDF Library"
 src="image/harulogo.png" style="width: 413px; height: 40px;"></div>
</div>
<div id="barcontainer">
<div class="buildbar"><a href="index.html">home</a> | <a
 href="http://sourceforge.net/project/showfiles.php?group_id=83044">download</a>
|
<a href="documentation.html">documentation</a> | <a
 href="examples.html">examples </a>| <a
 href="http://sourceforge.net/projects/libharu/">sourceforge</a> |
<a href="http://sourceforge.net/forum/?group_id=83044">forums</a><br>
</div>
</div>
<div id="container">
<div id="mainpage">
<div id="ccol">
<h2>Document Handling Functions<br>
</h2>
<h3><a name="HPDF_New_HPDF_NewEX_"></a>HPDF_New, HPDF_NewEX<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
"apdf.h"<br>
<br>
HPDF_Doc<br>
HPDF_New&nbsp; (HPDF_Error_Handler&nbsp;&nbsp;&nbsp; user_error_fn,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">void</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*user_data);<br>
<br>
HPDF_Doc<br>
HPDF_NewEx&nbsp; (HPDF_Error_Handler&nbsp;&nbsp; user_error_fn,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Alloc_Func&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_alloc_fn,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Free_Func&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; user_free_fn,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mem_pool_buf_size,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">void</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*user_data);
</div>
<h4>Description<br>
</h4>
HPDF_New() and HPDF_NewEX() create an instance of a document object and
initialize it. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">user_error_fn</span>
<div class="bodytext5">Specify <a
 href="error_handling.html#User-defined_error_handler_">user-defined
error handler</a> which is invoked when an error occurred.<br>
<br>
</div>
<span style="font-weight: bold;">user_alloc_fn</span>
<div class="bodytext5">Specify user-defined memory allocation
function. If NULL is specified,
malloc() is used.<br>
<br>
</div>
<span style="font-weight: bold;">user_free_fn</span>
<div class="bodytext5">Specify user-defined memory freeing function.
If NULL is specified,
free() is used.<br>
<br>
</div>
<span style="font-weight: bold;">mem_pool_buf_size</span>
<div class="bodytext5">On default setting, Haru does not use memory
pool. A memory allocation
function is called on demand from an application. If this parameter set
to non-zero value, a memory management will be done as following.<br>
<ul>
  <li>A memory is allocated&nbsp; per mem_pool_buf_size.</li>
  <li>Memory manager gives a memory of requested size to an
application. And pool the remaining memory to use at next request</li>
  <li>If the size of requested memory is larger than the remaining
memory, a new memory block is allocated.</li>
  <li>The unused memory is not released immediately. It is released all
together when HPDF_Free() is invoked.</li>
</ul>
</div>
<span style="font-weight: bold;">user_data</span>
<div class="bodytext5">Specify user-defind void pointer.This pointer
is used by error
handling.&nbsp; <br>
</div>
<br>
<h4>Returns</h4>
HPDF_New() and HPDF_NewEX() returns a handle of document object. If it
failed, it returns NULL.<br>
<br>
</div>
<h3><a name="HPDF_Free_"></a>HPDF_Free
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Doc<br>
HPDF_Free&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);
</div>
<h4>Description<br>
</h4>
HPDF_Free() revokes a document object and all resources. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.</div>
<br>
</div>
<h3><a name="HPDF_NewDoc_"></a>HPDF_NewDoc
</h3>
<div class="bodytext1">
<div class="bodycode2">#<span style="font-weight: bold;">include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_NewDoc&nbsp; (HPDF_Doc&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_NewDoc() creates new document. If document object already has a
document, the current document is revoked.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<br>
<h4>Returns</h4>
When HPDF_NewDoc succeeds, it returns HPDF_OK. Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<div class="bodytext5">Memory Allocation Failed.<br>
</div>
<br>
</div>
<h3><a name="HPDF_FreeDoc"></a>HPDF_FreeDoc&#12289;
HPDF_FreeDocAll
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
<span style="font-weight: bold;">void</span><br>
HPDF_FreeDoc&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
<span style="font-weight: bold;">void</span><br>
HPDF_FreeDocAll&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_FreeDoc(), HPDF_FreeDocAll() revokes the current document.
HPDF_FreeDoc() keeps loaded resource (such as fonts and encodings) and
these resources are recycled when new document required these
resources. HPDF_FreeDocAll() revokes the current document and all
resources.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<br>
</div>
<h3><a name="HPDF_SaveToFile_"></a>HPDF_SaveToFile<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SaveToFile&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const char</span>&nbsp; *file_name);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SaveToFile() saves the current document to a file.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">file_name</span>
<div class="bodytext5">Specify the name of file to save.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp;
HPDF_SaveToFile() succeeds, it returns HPDF_OK. Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FILE_IO_ERROR</span><br>
<div class="bodytext5">An error occurred while processing file I/O.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_SaveToStream_"></a>HPDF_SaveToStream<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SaveToStream&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SaveToStream() saves the current document to a temporary stream of
a document object.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp;
HPDF_SaveToStream() succeeds, it returns HPDF_OK. Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.<br>
</div>
</div>
<br>
<h3><a name="HPDF_GetStreamSize_"></a>HPDF_GetStreamSize<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_UINT32<br>
HPDF_GetStreamSize&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetStreamSize() gets the size of the temporary stream of the
document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp;
HPDF_GetStreamSize() succeeds, it returns the size of the temporary
stream of the document. Otherwise, it returns 0.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
</div>
</div>
<br>
<h3><a name="HPDF_ReadFromStream_"></a>HPDF_ReadFromStream<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_ReadFromStream&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_BYTE&nbsp;&nbsp;&nbsp;&nbsp; *buf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT32&nbsp;&nbsp; *size)<br>
</div>
<h4>Description<br>
</h4>
HPDF_ReadFromStream() copies the data from the temporary stream of the
document into the buffer.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">buf</span><br>
<div class="bodytext5">A pointer of the buffer.<br>
<br>
</div>
<span style="font-weight: bold;">size</span><br>
<div class="bodytext5">Specifiy the size of buffer. After
HPDF_ReadFromStream() is execute, the number of bytes that succeeds in
reading is set.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp;
HPDF_ReadFromStream() succeeds, it returns HPDF_OK or HPDF_STREAM_EOF.
Otherwise, it returns error-code and error-handler is invoked.<br>
<br>
<div class="bodynote">NOTE:
<br>
Even if the result of HPDF_ReadFromStream() is HPDF_EOF, if the value
of size parameter is more than 0, data is read into the buffer. </div>
&nbsp;
<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT<br>
</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_OPERATION</span><br>
<div class="bodytext5">No data is saved to the temporary stream of the
document.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PARAMETER</span>
<div class="bodytext5">An invalid value was set to 'size' parameter.<br>
</div>
</div>
<br>
<h3><a name="HPDF_ResetStream_"></a>HPDF_ResetStream<br>
</h3>
<br>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_ResetStream&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_ResetStream() rewinds the temporary stream of the document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp;
HPDF_ResetStream() succeeds, it returns HPDF_OK.
Otherwise, it returns error-code and error-handler is invoked.<br>
&nbsp;
<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT
</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_OPERATION</span>
<div class="bodytext5">No data is saved to the temporary stream of the
document.<br>
</div>
<br>
</div>
<h3><a name="HPDF_HasDoc"></a>HPDF_HasDoc</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_BOOL<br>
HPDF_HasDoc&nbsp; (HPDF_Doc&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SaveToFile() saves the current document to a file.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">file_name</span>
<div class="bodytext5">Specify the name of file to save.<br>
</div>
<br>
<h4>Returns</h4>
If the spacified document handle is valid, it returns HPDF_TRUE.
Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.</div>
<br>
</div>
<h3><a name="HPDF_SetErrorHandler_"></a>HPDF_SetErrorHandler<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SetErrorHandler&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Error_Handler&nbsp;&nbsp; user_error_fn);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetErrorHandler() sets an user-defined error handler. If a
function call fails,&nbsp; the function this error handler is called.<br>
<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">user_error_fn</span>
<div class="bodytext5">Specify <a
 href="error_handling.html#User-defined_error_handler_">user-defined
error handler</a> which is invoked when an error occurred. If this
parameter is set to NULL, the error-handler which has been set is
revoked.
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SaveToFile() succeeds, it returns HPDF_OK. Otherwise,
it returns error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.</div>
<br>
</div>
<h3><a name="HPDF_GetError_"></a>HPDF_GetError<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_GetError&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetError returns the last-error code of specified PdfDoc object.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object</div>
<br>
<h4>Returns</h4>
HPDF_GetError returns the last-error code of specified PdfDoc object.<br>
If there is no error, it returns HPDF_OK.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.</div>
<br>
</div>
<h3><a name="HPDF_ResetError_"></a>HPDF_ResetError<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
<span style="font-weight: bold;">void</span><br>
HPDF_ResetError&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
Once an error code is set, IO processing functions cannot be invoked.<br>
In the case of executing a function after the cause of the error is
fixed, an application have to invoke HPDF_ResetError to clear
error-code before executing functions.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object</div>
<br>
</div>
<h3><a name="HPDF_SetPagesConfiguration_"></a>HPDF_SetPagesConfiguration<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SetPagesConfiguration&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp; page_per_pages);<br>
<br>
</div>
<h4>Description<br>
</h4>
In the default setting, a HPDF_Doc object has one "Pages" object as
root of pages. All "Page" objects are created as a kid of the "Pages"
object.<br>
Since a "Pages" object can own only 8191 kids objects, the maximum
number of pages are 8191 page.<br>
<br>
<img alt="figure7.png" src="image/figure7.png"
 style="width: 302px; height: 143px;"><br>
Additionally, the state that there are a lot of&nbsp; "Page" object
under one "Pages" object is not good, because it causes performance
degradation of&nbsp; a viewer application.<br>
&nbsp;<br>
An application can change the setting of a pages tree by invoking
HPDF_SetPagesConfiguration(). If page_per_pages parameter is set to
more than zero, a two-tier pages tree is created. A root "Pages" object
can own 8191 "Pages" object, and each lower "Pages" object can own
page_per_pages "Page" objects. As a result, the maximum number of pages
becomes 8191 * page_per_pages page.<br>
<br>
<img alt="figure8" src="image/figure8.png"
 style="width: 471px; height: 202px;"><br>
An application cannot invoke HPDF_SetPageConfiguration() after a page
is
added to document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">page_per_pages</span><br>
<div class="bodytext5">Specify the numbers of pages that a "Pages"
object can own.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetPageConfiguration() succeeds, it returns HPDF_OK.
Otherwise,
it returns error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT_STATE</span><br>
<div class="bodytext5">A page object already exists in a document.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.
</div>
</div>
<br>
<h3>HPDF_SetPageLayout<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SetPageLayout&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_PageLayout&nbsp;&nbsp; layout);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetPageLayout() sets how the page should be displayed. If this
attribute is not set, the setting of a viewer application is used.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">layout<br>
</span>
<div class="bodytext5">The following values are available.<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);"><span
 style="font-weight: bold;">Value</span><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);"><span
 style="font-weight: bold;">Description</span><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_LAYOUT_SINGLE<br>
      </td>
      <td style="vertical-align: top;">Only one page is displayed.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_LAYOUT_ONE_COLUMN<br>
      </td>
      <td style="vertical-align: top;">Display the pages in one column.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_LAYOUT_TWO_COLUMN_LEFT<br>
      </td>
      <td style="vertical-align: top;">Display the pages in two column.
The page of the odd number is displayed left. <br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_LAYOUT_TWO_COLUMN_RIGHT<br>
      </td>
      <td style="vertical-align: top;">Display the pages in two column.
The page of the odd number is displayed right. <br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<h4>Returns</h4>
When HPDF_SetPageLayout() succeeds, it returns HPDF_OK.
Otherwise,
it returns error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_PAGE_LAYOUT_OUT_OF_RANGE<br>
</span>
<div class="bodytext5">An invalid page layout is specified.<br>
</div>
</div>
<br>
<h3><a name="HPDF_GetPageLayout_"></a>HPDF_GetPageLayout<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_PageLayout<br>
HPDF_GetPageLayout&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetPageLayout() returns the current setting for page layout.<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_GetPageLayout() succeeds, it returns the current
setting for page layout. If page layout is not set, it returns
HPDF_PAGE_LAYOUT_EOF<br>
</div>
<br>
<h3><a name="HPDF_SetPageMode_"></a>HPDF_SetPageMode<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetPageMode&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_PageMode&nbsp;&nbsp; mode);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetPageMode() sets how the document should be displayed. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">mode<br>
</span>
<div class="bodytext5">The following values are available.<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);"><span
 style="font-weight: bold;">Value</span><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);"><span
 style="font-weight: bold;">Description</span><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_MODE_USE_NONE<br>
      </td>
      <td style="vertical-align: top;">Display the document with
neither outline nor thumbnail. </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_MODE_USE_OUTLINE<br>
      </td>
      <td style="vertical-align: top;">Display the document with
outline pain.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_MODE_USE_THUMBS<br>
      </td>
      <td style="vertical-align: top;">Display the document with
thumbnail pain.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top;">HPDF_PAGE_MODE_FULL_SCREEN<br>
      </td>
      <td style="vertical-align: top;">Display the document with full
screen mode. <br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_SetPageMode() succeeds, it returns HPDF_OK.
Otherwise,
it returns error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle is set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_PAGE_MODE_OUT_OF_RANGE<br>
</span>
<div class="bodytext5">An invalid page mode is specified.<br>
</div>
</div>
<br>
<h3><a name="HPDF_GetPageMode_"></a>HPDF_GetPageMode<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
"apdf.h"<br>
<br>
HPDF_PageMode<br>
HPDF_GetPageMode&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetPageLayout() returns the current setting for page mode.<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_GetPageMode() succeeds, it returns the current
setting for page mode. <br>
</div>
<br>
<h3><a name="HPDF_SetOpenAction_"></a>HPDF_SetOpenAction<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_STATUS<br>
HPDF_SetOpenAction&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Destination&nbsp;&nbsp; open_action);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetOpenAction() set the first page appears when a document is
opened. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">open_action</span>
<div class="bodytext5">Set a valid destination object.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetOpenAction() succeeds, it returns HPDF_OK.
Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_DESTINATION</span><br>
<div class="bodytext5">An invalid destination object was set.<br>
</div>
</div>
<br>
<h3><a name="HPDF_GetCurrentPage_"></a>HPDF_GetCurrentPage<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include</span>
&lt;apdf.h&gt;<br>
<br>
HPDF_Page<br>
HPDF_GetCurrentPage&nbsp; (HPDF_Doc&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetPageLayout() returns the handle of current page object.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_GetPageLayout() succeeds, it returns the handle of a
current page object. Otherwise it returns NULL.<br>
</div>
<br>
<h3><a name="HPDF_AddPage"></a>HPDF_AddPage</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_Page<br>
HPDF_AddPage&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
</div>
<h4>Description<br>
</h4>
HPDF_AddPage() creates a new page and adds it after the last page of a
document. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_AddPage() succeeds, it returns the handle of created
page object. Otherwise, it returns
error-code and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span>
<br>
<div class="bodytext5">Memory Allocation Failed.
</div>
</div>
<br>
<h3><a name="HPDF_InsertPage"></a>HPDF_InsertPage</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>&lt;apdf.h&gt;<br>
<br>
HPDF_Page<br>
HPDF_InsertPage&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Page&nbsp;&nbsp; target)<br>
</div>
<h4>Description<br>
</h4>
HPDF_InsertPage() creates a new page and inserts it just before the
specified page. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">page
</span>
<div class="bodytext5">Specify the handle of a page object which
specifies the insertion place.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_InsertPage() succeeds, it returns the handle of created
page object. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PAGE</span><br>
<div class="bodytext5">An invalid page handle was set.
</div>
</div>
<br>
<h3><a name="HPDF_GetFont"></a>HPDF_GetFont</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Font<br>
HPDF_GetFont&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp; *font_name,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;
*encoding_name);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetFont gets the handle of a corresponding font object by
specified name and encoding.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">font_name
</span>
<div class="bodytext5">Specify a valid font name. (See "<a
 href="fonts.html">Fonts and Encodings</a>")<br>
<br>
</div>
<span style="font-weight: bold;">encoding_name
</span><br>
<div class="bodytext5">Specify a valid encoding name. (See "<a
 href="fonts.html">Fonts and Encodings</a>")<br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_GetFont() succeeds, it returns the handle of a font
object. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_FONT_NAME,
HPDF_UNSUPPORTED_FONT_TYPE
</span>
<div class="bodytext5">An invalid font name was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_ENCODING_NAME</span><br>
<div class="bodytext5">An invalid encoding name was set.
</div>
</div>
<br>
<h3><a name="HPDF_LoadType1FontFromFile"></a>HPDF_LoadType1FontFromFile</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
<span style="font-weight: bold;">const </span>char*<br>
HPDF_LoadType1FontFromFile&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp; *afmfilename,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp; *pfmfilename);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadType1FontFromFile loads a type1 font from an external file and
register it to a
document object. (See "<a href="fonts.html">Fonts
and Encodings</a>")<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">afm_file_name
</span>
<div class="bodytext5">A path of an AFM file. <br>
<br>
</div>
<span style="font-weight: bold;">data_file_name
</span><br>
<div class="bodytext5">A path of a PFA/PFB file. If it is NULL, the
gryph data of font file is not embedded to a PDF file.<br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_LoadType1FontFromFile() succeeds, it returns the name
of a font. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FONT_EXISTS</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_AFM_HEADER,
HPDF_INVALID_CHAR_MATRICS_DATA, HPDF_INVALID_N_DATA</span><br>
<div class="bodytext5">Cannot recognize AFM file.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_UNSUPPORTED_TYPE1_FONT</span><br>
<div class="bodytext5">Cannot recognize PFA/PFB file.<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadTTFontFromFile"></a>HPDF_LoadTTFontFromFile</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
<span style="font-weight: bold;">const </span>char*<br>
HPDF_LoadTTFontFromFile
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*file_name,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_BOOL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; embedding);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadTTFontFromFile loads a TrueType font from an external file and
register it to a
document object. (See "<a href="fonts.html">Fonts
and Encodings</a>")<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">file_name
</span>
<div class="bodytext5">A path of a TrueType font file (.ttf). <br>
<br>
</div>
<span style="font-weight: bold;">embedding </span><br>
<div class="bodytext5">If this parameter is set to HPDF_TRUE, the glyph
data of the font is embedded, otherwise only the matrix data is
included in PDF file.<br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_LoadTTFontFromFile() succeeds, it returns the name
of a font. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FONT_EXISTS</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_TTC_INDEX,
HPDF_INVALID_TTC_FILE, HPDF_TTF_INVALID_CMAP, HPDF_TTF_INVALID_FOMAT,
HPDF_TTF_MISSING_TABLE </span><br>
<div class="bodytext5">Failed to load .ttf file.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_TTF_CANNOT_EMBEDDING_FONT</span><br>
<div class="bodytext5">The font is not allowed to embed.<br>
<br>
</div>
<br>
</div>
<h3><a name="HPDF_LoadTTFontFromFile2"></a>HPDF_LoadTTFontFromFile2</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_LoadTTFontFromFile2 (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp; *file_name,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp; index,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_BOOL&nbsp;&nbsp;&nbsp; embedding);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadTTFontFromFile2 loads a TrueType font from an TrueType
collection file and register it to a
document object. (See "<a href="fonts.html">Fonts
and Encodings</a>")<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">file_name
</span>
<div class="bodytext5">A path of a TrueType font collection file
(.ttc). <br>
<br>
</div>
<span style="font-weight: bold;">index
</span>
<div class="bodytext5">The index of font that wants to be loaded. <br>
<br>
</div>
<span style="font-weight: bold;">embedding </span><br>
<div class="bodytext5">If this parameter is set to HPDF_TRUE, the glyph
data of the font is embedded, otherwise only the matrix data is
included in PDF file.<br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_LoadTTFontFromFile2() succeeds, it returns the name
of a font. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FONT_EXISTS</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_TTC_INDEX,
HPDF_INVALID_TTC_FILE, HPDF_TTF_INVALID_CMAP, HPDF_TTF_INVALID_FOMAT,
HPDF_TTF_MISSING_TABLE </span><br>
<div class="bodytext5">Failed to load .ttf file.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_TTF_CANNOT_EMBEDDING_FONT</span><br>
<div class="bodytext5">The font is not allowed to embed.<br>
</div>
<br>
<span style="font-weight: bold;">HPDF_INVALID_TTC_INDEX</span><br>
<div class="bodytext5">The value specified at index parameter exceeds
the number of fonts. &nbsp;<br>
</div>
<br>
</div>
<br>
<h3><a name="HPDF_AddPageLabel"></a>HPDF_AddPageLabel</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_AddPageLabel&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
page_num,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_PageNumStyle&nbsp;&nbsp; style,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
first_page,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*prefix);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_AddPageLabel() adds a page labeling range for the document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">page_num
</span>
<div class="bodytext5">The first page that applies this labeling range.
<br>
<br>
</div>
<span style="font-weight: bold;">style
</span>
<div class="bodytext5">The numbering style.<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="1"
 cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); width: 23px;"><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); width: 300px;">Value<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">Description<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 23px; text-align: right;">1<br>
      </td>
      <td style="vertical-align: top; width: 300px;">HPDF_PAGE_NUM_STYLE_DECIMAL<br>
      </td>
      <td style="vertical-align: top;">Page label is displayed by
Arabic numerals.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 23px; text-align: right;">2<br>
      </td>
      <td style="vertical-align: top; width: 300px;">HPDF_PAGE_NUM_STYLE_UPPER_ROMAN<br>
      </td>
      <td style="vertical-align: top;">Page label is displayed by
Uppercase roman numerals.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">3<br>
      </td>
      <td style="vertical-align: top; width: 300px;">HPDF_PAGE_NUM_STYLE_LOWER_ROMAN<br>
      </td>
      <td style="vertical-align: top;">Page label is displayed by
Lowercase roman numerals.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">4<br>
      </td>
      <td style="vertical-align: top; width: 300px;">HPDF_PAGE_NUM_STYLE_UPPER_LETTERS<br>
      </td>
      <td style="vertical-align: top;">Page label is displayed by
Uppercase letters (using A to Z).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">5<br>
      </td>
      <td style="vertical-align: top; width: 300px;">HPDF_PAGE_NUM_STYLE_LOWER_LETTERS<br>
      </td>
      <td style="vertical-align: top;">Page label is displayed by
Lowercase letters (using a to z).</td>
    </tr>
  </tbody>
</table>
<br>
</div>
<span style="font-weight: bold;">first_page </span>
<div class="bodytext5">The first page number in this range. <br>
<br>
</div>
<span style="font-weight: bold;">prefix </span>
<div class="bodytext5">The prefix for the page label. (NULL is
allowed.) <br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_AddPageLabel () succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_PAGE_NUM_STYLE_OUT_OF_RANGE</span><br>
<div class="bodytext5">An invalid page numbering style is specified.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseJPFonts"></a>HPDF_UseJPFonts</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseJPFonts&nbsp;&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseJPFonts() enables Japanese fonts. After HPDF_UseJPFonts() is
involed, an application can use the following Japanese fonts.<br>
<ul>
  <li>MS-Mincyo</li>
  <li>MS-Mincyo,Bold</li>
  <li>MS-Mincyo,Italic</li>
  <li>MS-Mincyo,BoldItalic</li>
  <li>MS-Gothic</li>
  <li>MS-Gothic,Bold</li>
  <li>MS-Gothic,Italic</li>
  <li>MS-Gothic,BoldItalic</li>
  <li>MS-PMincyo</li>
  <li>MS-PMincyo,Bold</li>
  <li>MS-PMincyo,Italic</li>
  <li>MS-PMincyo,BoldItalic</li>
  <li>MS-PGothic</li>
  <li>MS-PGothic,Bold</li>
  <li>MS-PGothic,Italic</li>
  <li>MS-PGothic,BoldItalic</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseJPFonts() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseKRFonts"></a>HPDF_UseKRFonts</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseKRFonts&nbsp;&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseKRFonts() enables Korean fonts. After HPDF_UseKRFonts()
is involed, an application can use the following Korean fonts.<br>
<ul>
  <li>DotumChe</li>
  <li>DotumChe,Bold</li>
  <li>DotumChe,Italic</li>
  <li>DotumChe,BoldItalic</li>
  <li>Dotum</li>
  <li>Dotum,Bold</li>
  <li>Dotum,Italic</li>
  <li>Dotum,BoldItalic</li>
  <li>BatangChe</li>
  <li>BatangChe,Bold</li>
  <li>BatangChe,Italic</li>
  <li>BatangChe,BoldItalic</li>
  <li>Batang</li>
  <li>Batang,Bold</li>
  <li>Batang,Italic</li>
  <li>Batang,BoldItalic</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseKRFonts() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseCNSFonts"></a>HPDF_UseCNSFonts</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseCNSFonts&nbsp;&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseCNSFonts() enables simplified Chinese fonts. After
HPDF_UseCNSFonts()
is involed, an application can use the following simplified Chinese
fonts.<br>
<ul>
  <li>SimSun</li>
  <li>SimSun,Bold</li>
  <li>SimSun,Italic</li>
  <li>SimSun,BoldItalic</li>
  <li>SimHei</li>
  <li>SimHei,Bold</li>
  <li>SimHei,Italic</li>
  <li>SimHei,BoldItalic</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseCNSFonts() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseCNTFonts"></a>HPDF_UseCNTFonts</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseCNTFonts&nbsp;&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseCNTFonts() enables traditional Chinese fonts. After
HPDF_UseCNTFonts()
is involed, an application can use the following traditional Chinese
fonts.<br>
<ul>
  <li>MingLiU</li>
  <li>MingLiU,Bold</li>
  <li>MingLiU,Italic</li>
  <li>MingLiU,BoldItalic</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseCNSFonts() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The font of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_CreateExtGstate"></a>HPDF_CreateExtGstate</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_ExtGState<br>
HPDF_CreateExtGState&nbsp; (HPDF_Doc&nbsp; pdf);;<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_CreateExtGState() creates a new extended graphics state object.<br>
As a side effect, HPDF_CreateExtGState() bumps up the version of PDF to
1.4.<br>
<br>
<div class="bodynote">NOTE:<br>
In Acrobat Reader 5.0, when ExtGState object is used combined with
HPDF_Page_Concat(), there is a case that cannot be correctly displayed.</div>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When
HPDF_CreateExtGState() succeeds, it returns the handle of created
extended graphics stateobject. Otherwise, it
returns NULL and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
</div>
</div>
<br>
<h3><a name="HPDF_CreateOutline"></a>HPDF_CreateOutline</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Outline<br>
HPDF_CreateOutline&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Outline&nbsp;&nbsp; parent,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;
*title,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Encoder&nbsp;&nbsp; encoder);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_CreateOutline() creates a new outline object.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">parent
</span>
<div class="bodytext5">The handle of an outline object which comes to
the parent of the created outline object.<br>
If this parameter is NULL, The outline is created as a root outline.<br>
<br>
</div>
<span style="font-weight: bold;">title
</span>
<div class="bodytext5">The caption of the outline object.<br>
<br>
</div>
<span style="font-weight: bold;">encoder</span><br>
<div class="bodytext5">The handle of an encoding object applied to the
title. If NULL is set, PDFDocEncoding is used.<br>
</div>
<br>
<h4>Returns</h4>
When
HPDF_CreateOutline() succeeds, it returns the handle of created outline
object. Otherwise, it
returns NULL and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_OUTLINE</span><br>
<div class="bodytext5">An invalid parent outline is specified.<br>
</div>
</div>
<br>
<br>
<h3><a name="HPDF_GetEncoder"></a>HPDF_GetEncoder</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Encoder<br>
HPDF_GetEncoder&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;
*encoding_name);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetEncoder() gets the handle of a corresponding encoder object by
specified encoding name.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">encoding_name
</span><br>
<div class="bodytext5">Specify a valid encoding name. (See "<a
 href="fonts.html">Fonts and Encodings</a>")<br>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_GetEncoder() succeeds, it returns the handle of an
encoder object. Otherwise, it returns NULL and error-handler is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_ENCODING_NAME</span><br>
<div class="bodytext5">An invalid encoding name was set.
</div>
</div>
<br>
<h3><a name="HPDF_GetCurrentEncoder"></a>HPDF_GetCurrentEncoder</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Encoder<br>
HPDF_GetCurrentEncoder&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetCurrentEncoder() gets the handle of the current encoder of the
document object.<br>
The current encoder is set by invoking HPDF_SetCurrentEncoder() and it
is used to processing a text&nbsp; when an application invoks
HPDF_Info_SetInfoAttr().<br>
The default value of it is NULL.<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">A handle of a document object.<br>
</div>
<h4>Returns</h4>
It returns a handle of an encoder object or NULL.<br>
<br>
</div>
<h3><a name="HPDF_SetCurrentEncoder"></a>HPDF_SetCurrentEncoder</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Outline<br>
HPDF_SetCurrentEncoder&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;
*encoding_name);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetCurrentEncoder() sets the current encoder for the document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">encoding_name
</span>
<div class="bodytext5">The name of an encoding. (See "<a
 href="fonts.html">Fonts and Encodings</a>")<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_SetCurrentEncoder() succeeds, it returns the handle of
created outline
object. Otherwise, it
returns NULL and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_ENCODING_NAME</span><br>
<div class="bodytext5">An invalid encoding name was set.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseJPEncodings"></a>HPDF_UseJPEncodings</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseJPEncodings&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseJPEncodings() enables Japanese encodings. After
HPDF_UseJPEncodings() is
involed, an application can use the following Japanese encodings.<br>
<ul>
  <li>90ms-RKSJ-H</li>
  <li>90ms-RKSJ-V</li>
  <li>90msp-RKSJ-H</li>
  <li>EUC-H</li>
  <li>EUC-V</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseJPEncodings() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The encoding of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseKREncodings"></a>HPDF_UseKREncodings</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseKREncodings&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseKREncodings() enables Korean encodings. After
HPDF_UseKREncodings() is
involed, an application can use the following Korean encodings.<br>
<ul>
  <li>KSC-EUC-H</li>
  <li>KSC-EUC-V</li>
  <li>KSCms-UHC-H</li>
  <li>KSCms-UHC-HW-H</li>
  <li>KSCms-UHC-HW-V</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseKREncodings() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The encodingof the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseCNSEncodings"></a>HPDF_UseCNSEncodings</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseCNSEncodings&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseCNSEncodings() enables simplified Chinese encodings. After
HPDF_UseCNSEncodings()
is involed, an application can use the following simplified Chinese
encodings.<br>
<ul>
  <li>GB-EUC-H</li>
  <li>GB-EUC-V</li>
  <li>GBK-EUC-H</li>
  <li>GBK-EUC-V</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseCNSEncodings() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The encoding of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_UseCNTEncodings"></a>HPDF_UseCNTEncodings</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_UseCNTEncodings&nbsp; (HPDF_Doc&nbsp;&nbsp; pdf);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_UseCNTEncodings() enables traditional Chinese encodings. After
HPDF_UseCNTEncodings()
is involed, an application can use the following traditional Chinese
encodings.<br>
<ul>
  <li>GB-EUC-H</li>
  <li>GB-EUC-V</li>
  <li>GBK-EUC-H</li>
  <li>GBK-EUC-V</li>
</ul>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">The handle of a document object.<br>
<br>
</div>
<h4>Returns</h4>
When HPDF_UseCNTEncodings() succeeds, it returns HPDF_OK. Otherwise, it
returns error code and error-handler is invoked.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_DUPLICATE_REGISTRATION</span><br>
<div class="bodytext5">The encoding of the same name has already been
registered.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadPngImageFromFile_"></a>HPDF_LoadPngImageFromFile<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Image<br>
HPDF_LoadPngImageFromFile (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
const char&nbsp;&nbsp;&nbsp; *filename);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadPngImageFromFile() loads an external png image file. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">filename
</span>
<div class="bodytext5">A path to a PNG image file. <br>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_LoadPngImageFromFile() succeeds, it returns the handle
of an image object. Otherwise, it returns NULL and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_UNSUPPORTED_FUNC</span><br>
<div class="bodytext5">The library is not configured to use PNGLIB.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_LIBPNG_ERROR</span><br>
<div class="bodytext5">Failed when invoking PNGLIB's function.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PNG_IMAGE</span><br>
<div class="bodytext5">Invalid png format.<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadPngImageFromFile2_"></a>HPDF_LoadPngImageFromFile2<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Image<br>
HPDF_LoadPngImageFromFile2 (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;
*filename);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadPngImageFromFile2() loads an external png image file.<br>
Unlike&nbsp;
HPDF_LoadPngImageFromFile(),&nbsp;
HPDF_LoadPngImageFromFile2() does not load whole data immediately.
(only size and color properties is loaded). <br>
The main data is loaded just before the image object is written to PDF,
and the loaded data is deleted immediately. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">filename
</span>
<div class="bodytext5">A path to a PNG image file. <br>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_LoadPngImageFromFile2() succeeds, it returns the handle
of an image object. Otherwise, it returns NULL and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_UNSUPPORTED_FUNC</span><br>
<div class="bodytext5">The library is not configured to use PNGLIB.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_LIBPNG_ERROR</span><br>
<div class="bodytext5">Failed when invoking PNGLIB's function.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PNG_IMAGE</span><br>
<div class="bodytext5">Invalid png format.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadRawImageFromFile_"></a>HPDF_LoadRawImageFromFile<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Image<br>
HPDF_LoadRawImageFromFile&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*filename,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_ColorSpace&nbsp;&nbsp;&nbsp; color_space);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadRawImageFromFile() loads an image which has "raw" image format.<br>
This function loads the data without any conversion. So it is usually
faster than the other functions.<br>
&nbsp;<br>
HPDF_LoadRawImageFromFile() can load 3 types of format described below.<br>
<br>
<span style="font-weight: bold;">1. 8 bit gray scale image.
</span>
<div class="bodytext5">The gray scale describes one pixel by one byte.
And the size of the image data is same as width * height.<br>
The sequence of the data is as follows.<br>
<br>
<table style="width: 100px; text-align: left;" border="1"
 cellpadding="1" cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">1<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">2<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">3<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">4<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">6<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">7<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">8<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">9<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">11<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">12<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">13<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;">14<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<span style="font-weight: bold;">1. 24bit RGB color image.
</span>
<div class="bodytext5">The 24bit RGB color image describes one pixel by
3 byte (each one byte describes a value of either red, green or blue).
And the size of the image is same as width * height * 3.<br>
The sequence of the data is as follows.<br>
<br>
<table style="width: 100px; text-align: left;" border="1"
 cellpadding="1" cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">1<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">1<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">1<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">2<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">2<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">2<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">3<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">3<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">3<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">4<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">4<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">4<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">6<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">6<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">6<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">7<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">7<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">7<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">8<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">8<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">8<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">9<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">9<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">9<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">11<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">11<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">11<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">12<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">12<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">12<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">13<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">13<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 255, 255); text-align: center;">13<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(255, 204, 204); text-align: center;">14<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(153, 255, 153); text-align: center;">14<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">14<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<span style="font-weight: bold;">1. 36bit CMYK color image.
</span><br>
<div class="bodytext5">The 36bit CMYK color image describes one pixel
by 4 byte (each one byte describes a value of either Cyan Magenta
Yellow Black). And the size of the image is same as width * height * 4.
<br>
The sequence of the data is as follows.<br>
<br>
<table style="width: 100px; text-align: left;" border="1"
 cellpadding="1" cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">1<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">1<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">1<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">1<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">2<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">2<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">2<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">2<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">3<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">3<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">3<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">3<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">4<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">4<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">4<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">4<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">6<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">6<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">6<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">6<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">7<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">7<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">7<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">7<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">8<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">8<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">8<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">8<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">9<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">9<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">9<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">9<br>
      </td>
    </tr>
    <tr>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">11<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">11<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">11<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">11<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">12<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">12<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">12<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">12<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">13<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">13<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">13<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">13<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 255, 255);">14<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 204, 255);">14<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(255, 255, 153);">14<br>
      </td>
      <td
 style="vertical-align: top; text-align: center; background-color: rgb(204, 204, 204);">14<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">filename
</span>
<div class="bodytext5">A path to a image file.<br>
&nbsp;<br>
</div>
<span style="font-weight: bold;">width</span><br>
<div class="bodytext5">The width of an image file. <br>
<br>
</div>
<span style="font-weight: bold;">height</span><br>
<div class="bodytext5">The height of an image file. <br>
<br>
</div>
<span style="font-weight: bold;">color_space</span><br>
<div class="bodytext5">HPDF_CS_DEVICE_GRAY or HPDF_CS_DEVICE_RGB or
HPDF_CS_DEVICE_CMYK is allowed.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_LoadRawImageFromFile() succeeds, it returns the handle
of an image object. Otherwise, it returns NULL and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_COLOR_SPACE</span><br>
<div class="bodytext5">An invalid color_space value is specified.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_IMAGE</span><br>
<div class="bodytext5">The size of an image data is invalid.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FILE_IO_ERROR</span><br>
<div class="bodytext5">Cannot read data from the file.<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadRawImageFromMem_"></a>HPDF_LoadRawImageFromMem<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Image<br>
HPDF_LoadRawImageFromMem&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>HPDF_BYTE&nbsp;&nbsp;
*buf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_ColorSpace&nbsp;&nbsp;&nbsp; color_space,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bits_per_component);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadRawImageFromMem() loads an image which has "raw" image format
from buffer.<br>
This function loads the data without any conversion. So it is usually
faster than the other functions.<br>
&nbsp;<br>
The formats that HPDF_LoadRawImageFromMem() can load is the same as
HPDF_LoadRawImageFromFile().<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">buf</span>
<div class="bodytext5">The pointer to the image data.<br>
&nbsp;<br>
</div>
<span style="font-weight: bold;">width</span><br>
<div class="bodytext5">The width of an image file. <br>
<br>
</div>
<span style="font-weight: bold;">height</span><br>
<div class="bodytext5">The height of an image file. <br>
<br>
</div>
<span style="font-weight: bold;">color_space</span><br>
<div class="bodytext5">HPDF_CS_DEVICE_GRAY or HPDF_CS_DEVICE_RGB or
HPDF_CS_DEVICE_CMYK is allowed.<br>
<br>
</div>
<span style="font-weight: bold;">bits_per_component</span><br>
<div class="bodytext5">The bit size of each color component. The valid
value is either 1, 2, 4, 8. <br>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_LoadRawImageFromMem() succeeds, it returns the handle
of an image object. Otherwise, it returns NULL and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_COLOR_SPACE</span><br>
<div class="bodytext5">An invalid color_space value is specified.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_IMAGE</span><br>
<div class="bodytext5">The size of an image data is invalid.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_LoadJpegImageFromFile_"></a>HPDF_LoadJpegImageFromFile<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_Image<br>
HPDF_LoadJpegImageFromFile (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;
*filename);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_LoadJpegImageFromFile() loads an external Jpeg image file.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">filename
</span>
<div class="bodytext5">A path to a Jpeg image file. <br>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_LoadJpegImageFromFile() succeeds, it returns the handle
of an image object. Otherwise, it returns NULL and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_UNSUPPORTED_JPEG_FORMAT</span><br>
<div class="bodytext5">Unsupported () JPEG image format.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_SetInfoAttr_"></a>HPDF_SetInfoAttr<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetInfoAttr (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_InfoType&nbsp;&nbsp; type,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<span style="font-weight: bold;">const </span>char&nbsp;&nbsp;&nbsp;&nbsp;
*value);<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetInfoAttr() sets the text of the info dictionary.
HPDF_SetInfoAttr() uses the current encoding of the document. If it is
not set, the PDFDocEncoding is used.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">type</span>
<div class="bodytext5">The following values are available.<br>
<ul>
  <li>HPDF_INFO_AUTHOR</li>
  <li>HPDF_INFO_CREATOR<br>
  </li>
  <li>HPDF_INFO_TITLE<br>
  </li>
  <li>HPDF_INFO_SUBJECT</li>
  <li>HPDF_INFO_KEYWORDS<br>
  </li>
</ul>
</div>
<span style="font-weight: bold;">value</span><br>
<div class="bodytext5">A text to set the infomation. <br>
</div>
<br>
<h4>Returns</h4>
When HPDF_SetInfoAttr() succeeds, it returns HPDF_OK. Otherwise,
it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PARAMETER</span><br>
<div class="bodytext5">An invalid type parameter was set.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_GetInfoAttr"></a>HPDF_GetInfoAttr</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
<span style="font-weight: bold;">const </span>char*<br>
HPDF_GetInfoAttr (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_InfoType&nbsp;&nbsp; type);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_GetInfoAttr() gets the string value fron info dictionary.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">type</span>
<div class="bodytext5">The following values are available.<br>
<ul>
  <li>HPDF_INFO_CREATION_DATE</li>
  <li>HPDF_INFO_MOD_DATE</li>
  <li>HPDF_INFO_AUTHOR</li>
  <li>HPDF_INFO_CREATOR<br>
  </li>
  <li>HPDF_INFO_TITLE<br>
  </li>
  <li>HPDF_INFO_SUBJECT</li>
  <li>HPDF_INFO_KEYWORDS</li>
</ul>
</div>
<h4>Returns</h4>
When HPDF_GetInfoAttr() succeeds, it returns the string value of the
info dictionary.<br>
If the infomation has not been set or an error has occurred, it returns
NULL<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PARAMETER</span><br>
<div class="bodytext5">An invalid type parameter was set.<br>
</div>
</div>
<br>
<h3><a name="HPDF_SetInfoDateAttr_"></a>HPDF_SetInfoDateAttr<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
typedef&nbsp; struct&nbsp; _HPDF_Date {<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; year;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; month;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; day;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; hour;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; minutes;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; seconds;<br>
&nbsp;&nbsp;&nbsp; char&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ind;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; off_hour;<br>
&nbsp;&nbsp;&nbsp; HPDF_INT&nbsp;&nbsp;&nbsp; off_minutes;<br>
} HPDF_Date;<br>
<br>
HPDF_STATUS<br>
HPDF_Info_SetInfoDateAttr (HPDF_Dict&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; info,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_InfoType&nbsp; type,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; value);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetInfoDateAttr() sets the datetime value to the info dictionary. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">type</span>
<div class="bodytext5">The following values are available.<br>
<ul>
  <li>HPDF_INFO_CREATION_DATE</li>
  <li>HPDF_INFO_MOD_DATE<br>
  </li>
</ul>
</div>
<span style="font-weight: bold;">value</span><br>
<div class="bodytext5">A datetime value to set the infomation.<br>
<br>
HPDF_Date struct<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="2"
 cellspacing="2">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204); width: 28px; text-align: right;"><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">name<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">effective
values<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">1<br>
      </td>
      <td style="vertical-align: top;">year<br>
      </td>
      <td style="vertical-align: top;"><br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">2<br>
      </td>
      <td style="vertical-align: top;">month<br>
      </td>
      <td style="vertical-align: top;">between 1 and 12.</td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">3<br>
      </td>
      <td style="vertical-align: top;">day<br>
      </td>
      <td style="vertical-align: top;">between 1 and ether of 28, 29,
30, 31. (It is different by the month.)<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">4<br>
      </td>
      <td style="vertical-align: top;">hour<br>
      </td>
      <td style="vertical-align: top;">0 to 23<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">5<br>
      </td>
      <td style="vertical-align: top;">minutes<br>
      </td>
      <td style="vertical-align: top;">0 to 59<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">6<br>
      </td>
      <td style="vertical-align: top;">seconds<br>
      </td>
      <td style="vertical-align: top;">0 to 59<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">7<br>
      </td>
      <td style="vertical-align: top;">ind<br>
      </td>
      <td style="vertical-align: top;">the relationship of local time
to Universal Time.<br>
" ", +, &#8722;, and Z are available.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">8<br>
      </td>
      <td style="vertical-align: top;">off_hour<br>
      </td>
      <td style="vertical-align: top;">if ind is not space, 0 to 23 is
valid. Otherwise, this value is ignored.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; width: 28px; text-align: right;">9<br>
      </td>
      <td style="vertical-align: top;">off_minutes<br>
      </td>
      <td style="vertical-align: top;">if ind is not space, 0 to 59 is
valid. Otherwise, this value is ignored.</td>
    </tr>
  </tbody>
</table>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetInfoDateAttr() succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PARAMETER</span><br>
<div class="bodytext5">An invalid type parameter was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_DATE_TIME
</span>
<div class="bodytext5">An invalid datetime value was set.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_SetPassword_"></a>HPDF_SetPassword<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetPassword&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
const char&nbsp;&nbsp; *owner_passwd,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
const char&nbsp;&nbsp; *user_passwd);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetPassword() sets the pasword for the document.<br>
If the password is set, contents in the document are encrypted. <br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">owner_password</span>
<div class="bodytext5">The password for the owner of the document. The
owner can change the permission of the document.<br>
NULL, zero length string and the same value as user password are not
allowed. <br>
<br>
</div>
<span style="font-weight: bold;">user_password</span><br>
<div class="bodytext5">The password for the user of the document. The
user_password is allowed to be set to NULL or zero length string.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetPassword() succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_PASSWORD</span><br>
<div class="bodytext5">NULL, zero length string and the same value as
user password are set to owner-password.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_SetPermission_"></a>HPDF_SetPermission<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetPermission&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp; permission);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetPermission() set the flags of the permission for the document.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">permission</span><br>
<div class="bodytext5">The flags specifying which operations are
permitted. This parameter is set by logical addition of the following
values.<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="1"
 cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; text-align: right; width: 24px; background-color: rgb(204, 204, 204);"><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">value<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">description<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">1<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENABLE_READ<br>
      </td>
      <td style="vertical-align: top;">user can read the document.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">2<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENABLE_PRINT<br>
      </td>
      <td style="vertical-align: top;">user can print the document.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">3<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENABLE_EDIT_ALL<br>
      </td>
      <td style="vertical-align: top;">user can edit the contents of
the document other than annotations, form fields.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">4<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENABLE_COPY<br>
      </td>
      <td style="vertical-align: top;">user can copy the text and the
graphics of the document.</td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">5<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENABLE_EDIT<br>
      </td>
      <td style="vertical-align: top;">user can add or modify the
annotations and form fields of the document.<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetPermission() succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM</span><br>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
</div>
<br>
<h3><a name="HPDF_SetEncryptionMode_"></a>HPDF_SetEncryptionMode<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetEncryptionMode&nbsp;
(HPDF_Doc&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_EncryptMode&nbsp;&nbsp; mode,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
key_len);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetEncryptionMode() set the type of encryption.<br>
As the side effect, HPDF_SetEncryptionMode() ups the version of PDF to
1.4 when the mode is set to HPDF_ENCRYPT_R3.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">mode</span><br>
<div class="bodytext5">The flags specifying which operations are
permitted. This parameter is set by logical addition of the following
values.<br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="1"
 cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; text-align: right; width: 24px; background-color: rgb(204, 204, 204);"><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">value<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">description<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">1<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENCRYPT_R2<br>
      </td>
      <td style="vertical-align: top;">Use "Revision 2" algorithm.<br>
The length of key is automatically set to 5(40bit).<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">2<br>
      </td>
      <td style="vertical-align: top;">HPDF_ENCRYPT_R3<br>
      </td>
      <td style="vertical-align: top;">Use "Revision 3" algorithm.<br>
Between 5(40bit) and 16(128bit) can be specified for length of the key.
      <br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<span style="font-weight: bold;">key_len</span><br>
<div class="bodytext5">Specify the byte length of an encryption key.
This parameter is valid only when "mode" parameter is set to
HPDF_ENCRYPT_R3.<br>
Between 5(40bit) and 16(128bit) can be specified for length of the key.<br>
</div>
<br>
<h4>Returns</h4>
When&nbsp; HPDF_SetEncryptionMode() succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_ENCRYPT_KEY_LEN</span><br>
<div class="bodytext5">An invalid key length was specified.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM<br>
</span>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<br>
</div>
<h3><a name="HPDF_SetCompressionMode_"></a>HPDF_SetCompressionMode<br>
</h3>
<div class="bodytext1">
<div class="bodycode2"><span style="font-weight: bold;">#include </span>"apdf.h"<br>
<br>
HPDF_STATUS<br>
HPDF_SetCompressionMode&nbsp; (HPDF_Doc&nbsp;&nbsp;&nbsp; pdf,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HPDF_UINT&nbsp;&nbsp; mode);<br>
<br>
</div>
<h4>Description<br>
</h4>
HPDF_SetCompressionMode() set the mode of compression.<br>
<br>
<h4>Parameter</h4>
<span style="font-weight: bold;">pdf</span>
<div class="bodytext5">Specify the handle of a document object.<br>
<br>
</div>
<span style="font-weight: bold;">mode</span><br>
<div class="bodytext5">The flags specifying which type of contents
should be compressed. <br>
<table style="width: 100%; text-align: left;" border="1" cellpadding="1"
 cellspacing="1">
  <tbody>
    <tr>
      <td
 style="vertical-align: top; text-align: right; width: 24px; background-color: rgb(204, 204, 204);"><br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">value<br>
      </td>
      <td
 style="vertical-align: top; background-color: rgb(204, 204, 204);">description<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">1<br>
      </td>
      <td style="vertical-align: top;">HPDF_COMP_NONE<br>
      </td>
      <td style="vertical-align: top;">All contents are not compressed.
      <br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right; width: 24px;">2<br>
      </td>
      <td style="vertical-align: top;">HPDF_COMP_TEXT<br>
      </td>
      <td style="vertical-align: top;">Compress the contents stream of
the page. &nbsp; </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">3<br>
      </td>
      <td style="vertical-align: top;">HPDF_COMP_IMAGE<br>
      </td>
      <td style="vertical-align: top;">Compress the streams of the
image
objects.&nbsp; <br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">4<br>
      </td>
      <td style="vertical-align: top;">HPDF_COMP_METADATA<br>
      </td>
      <td style="vertical-align: top;">Other stream datas (fonts,
cmaps and so on)&nbsp; are compressed.<br>
      </td>
    </tr>
    <tr>
      <td style="vertical-align: top; text-align: right;">5<br>
      </td>
      <td style="vertical-align: top;">HPDF_COMP_ALL</td>
      <td style="vertical-align: top;">All stream datas are compressed.
(The same as "HPDF_COMP_TEXT | HPDF_COMP_IMAGE | HPDF_COMP_METADATA")<br>
      </td>
    </tr>
  </tbody>
</table>
<br>
</div>
<h4>Returns</h4>
When&nbsp; HPDF_SetCompressionMode() succeeds, it returns HPDF_OK.
Otherwise, it returns error code and error-handler
is called.<br>
&nbsp;<br>
<h4>Error</h4>
<span style="font-weight: bold;">HPDF_INVALID_DOCUMENT</span>
<div class="bodytext5">An invalid document handle was set.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_INVALID_COMPRESSION_MODE</span><br>
<div class="bodytext5">An invalid compression mode was specified.<br>
<br>
</div>
<span style="font-weight: bold;">HPDF_FAILD_TO_ALLOC_MEM
</span>
<div class="bodytext5">Memory Allocation Failed.<br>
<br>
</div>
<br>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<div id="lcol">
<div class="sidebar">
<ul>
</ul>
<ul>
  <li><a href="#HPDF_New_HPDF_NewEX_">HPDF_New, HPDF_NewEX</a></li>
  <li><a href="#HPDF_Free_">HPDF_Free</a><br>
  </li>
  <li><a href="#HPDF_NewDoc_">HPDF_NewDoc</a></li>
  <li><a href="#HPDF_FreeDoc">HPDF_FreeDoc&#12289;
HPDF_FreeDocAll</a></li>
  <li><a href="#HPDF_SaveToFile_">HPDF_SaveToFile</a></li>
  <li><a href="#HPDF_SaveToStream_">HPDF_SaveToStream</a></li>
  <li><a href="#HPDF_GetStreamSize_">HPDF_GetStreamSize</a></li>
  <li><a href="#HPDF_ReadFromStream_">HPDF_ReadFromStream</a></li>
  <li><a href="#HPDF_ResetStream_">HPDF_ResetStream</a><br>
  </li>
  <li><a href="#HPDF_HasDoc">HPDF_HasDoc</a></li>
  <li><a href="#HPDF_SetErrorHandler_">HPDF_SetErrorHandler</a></li>
  <li><a href="#HPDF_GetError_">HPDF_GetError</a></li>
  <li><a href="#HPDF_ResetError_">HPDF_ResetError</a></li>
  <li><a href="#HPDF_SetPagesConfiguration_">HPDF_SetPagesConfiguration</a></li>
  <li><a href="#HPDF_GetPageLayout_">HPDF_SetPageLayout</a></li>
  <li><a href="#HPDF_GetPageLayout_">HPDF_GetPageLayout</a></li>
  <li><a href="#HPDF_SetPageMode_">HPDF_SetPageMode</a></li>
  <li><a href="#HPDF_GetPageMode_">HPDF_GetPageMode</a></li>
  <li><a href="#HPDF_SetOpenAction_">HPDF_SetOpenAction</a></li>
  <li><a href="#HPDF_GetCurrentPage_">HPDF_GetCurrentPage</a></li>
  <li><a href="#HPDF_AddPage">HPDF_AddPage</a></li>
  <li><a href="#HPDF_InsertPage">HPDF_InsertPage</a></li>
  <li><a href="#HPDF_GetFont">HPDF_GetFont</a></li>
  <li><a href="#HPDF_LoadType1FontFromFile">HPDF_LoadType1FontFromFile</a></li>
  <li><a href="#HPDF_LoadTTFontFromFile">HPDF_LoadTTFontFromFile</a></li>
  <li><a href="#HPDF_LoadTTFontFromFile2">HPDF_LoadTTFontFromFile2</a></li>
  <li><a href="#HPDF_AddPageLabel">HPDF_AddPageLabel</a></li>
  <li><a href="#HPDF_UseJPFonts">HPDF_UseJPFonts</a></li>
  <li><a href="#HPDF_UseKRFonts">HPDF_UseKRFonts</a></li>
  <li><a href="#HPDF_UseCNSFonts">HPDF_UseCNSFonts</a></li>
  <li><a href="#HPDF_UseCNTFonts">HPDF_UseCNTFonts</a></li>
  <li><a href="#HPDF_CreateExtGstate">HPDF_CreateExtGState<br>
    </a></li>
  <li><a href="#HPDF_CreateOutline">HPDF_CreateOutline</a></li>
  <li><a href="#HPDF_GetEncoder">HPDF_GetEncoder</a></li>
  <li><a href="#HPDF_GetCurrentEncoder">HPDF_GetCurrentEncoder</a></li>
  <li><a href="#HPDF_SetCurrentEncoder">HPDF_SetCurrentEncoder</a></li>
  <li><a href="#HPDF_UseJPEncodings">HPDF_UseJPEncodings</a></li>
  <li><a href="#HPDF_UseKREncodings">HPDF_UseKREncodings</a></li>
  <li><a href="#HPDF_UseCNSEncodings">HPDF_UseCNSEncodings</a></li>
  <li><a href="#HPDF_UseCNTEncodings">HPDF_UseCNTEncodings</a></li>
  <li><a href="#HPDF_LoadPngImageFromFile_">HPDF_LoadPngImageFromFile</a></li>
  <li><a href="#HPDF_LoadPngImageFromFile2_">HPDF_LoadPngImageFromFile2</a></li>
  <li><a href="#HPDF_LoadRawImageFromFile_">HPDF_LoadRawImageFromFile</a></li>
  <li><a href="#HPDF_LoadRawImageFromMem_">HPDF_LoadRawImageFromMem</a></li>
  <li><a href="#HPDF_LoadJpegImageFromFile_">HPDF_LoadJpegImageFromFile</a></li>
  <li><a href="#HPDF_SetInfoAttr_">HPDF_SetInfoAttr</a></li>
  <li><a href="#HPDF_GetInfoAttr">HPDF_GetInfoAttr</a></li>
  <li><a href="#HPDF_SetInfoDateAttr_">HPDF_SetInfoDateAttr</a></li>
  <li><a href="#HPDF_SetPassword_">HPDF_SetPassword</a></li>
  <li><a href="#HPDF_SetPermission_">HPDF_SetPermission</a></li>
  <li><a href="#HPDF_SetEncryptionMode_">HPDF_SetEncryptionMode</a></li>
  <li><a href="#HPDF_SetCompressionMode_">HPDF_SetCompressionMode</a><br>
  </li>
</ul>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
</body>
</html>
